<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/login.css">
    <link rel="shortcut icon" href="images/title-logo.jpg">
</head>

<body>
    <img src="images\tencent.png" alt="">
    <!-- <img src="images\black.png" alt=""> -->
    <div class="main">
        <table class="table">
            <h1>新用户注册</h1>
            <tr>
                <td><label for="username">用户名:</label></td>
                <td><input class="input" type="text" name="username" placeholder="请输入用户名,由数字和字母组成,长度为11位" id="username">
                </td>
            </tr>
            <tr>
                <td><label for="password">密码:</label></td>
                <td><input class="input" type="text" name="password" placeholder="请输入密码,由数字和字母组成,长度大于8位" id="password">
                </td>
            </tr>
            <tr>
                <td><label for="email">邮箱：</label></td>
                <td><input class="input" type="text" id="email" placeholder="请输入邮箱"></td>
            </tr>
            <div><button class="sumbit"><span>注册</span></button></div>
        </table>
    </div>
    <script type="text/javascript" src="js/login.js"></script>
    <!-- <script>
        function pipei(temp) {
            let boll = false
            for (let i = 0; i < temp.length; i++) {
                if ((temp[i] >= 'A' && temp[i] <= 'Z') || (temp[i] >= 'a' && temp[i] <= 'z') || (temp[i] >= '0' && temp[i] <= '9')) {
                    boll = true
                }
                else {
                    boll = false
                }
            }
            return boll
        }
        const sumbit = document.querySelector('.sumbit')
        sumbit.addEventListener('click', function () {
            let username_value = false
            let password_value = false
            let username = document.querySelector('#username')
            let password = document.querySelector('#password')
            let email = document.querySelector('#email')
            password = password.value
            username = username.value
            email = email.value
            if (username.length == 11 && pipei(username)) {
                username_value = true
            }
            if (password.length >= 8 && pipei(password)) {
                password_value = true
            }
            if (username_value && password_value) {
                alert("注册成功")
                // setTimeout(3000)
                window.location.href = 'file:///E:/%E6%A1%8C%E9%9D%A2/javascript%E8%AE%BE%E8%AE%A1/denglu.html';
                localStorage.setItem('uname', `${username}`)
                localStorage.setItem('password', `${password}`)
                localStorage.setItem('email', `${email}`)
            }
            else {
                alert("用户名或密码格式错误")
            }

        })
    </script> -->
</body>

</html>